/* global axios */
import ApiClient from './ApiClient'

class Inboxes extends ApiClient {
  constructor () {
    super('inboxes', { accountScoped: true })
  }

  getCampaigns (inboxId) {
    return axios.get(`${this.url}/${inboxId}/campaigns`)
  }

  deleteInboxAvatar (inboxId) {
    return axios.delete(`${this.url}/${inboxId}/avatar`)
  }

  getAgentBot (inboxId) {
    return axios.get(`${this.url}/${inboxId}/agentBot`)
  }

  setAgentBot (inboxId, botId) {
    return axios.post(`${this.url}/${inboxId}/setAgentBot`, {
      agent_bot: botId,
    })
  }

  setConversationAssignment (inboxId, data) {
    return axios.patch(`${this.url}/${inboxId}/conversationAssignment`, data)
  }

  updateInboxWorkingHours (inboxId, data) {
    return axios.patch(`${this.url}/${inboxId}/updateInboxWorkingHours`, data)
  }

  setPreChatForm (inboxId, data) {
    return axios.patch(`${this.url}/${inboxId}/preChatForm`, data)
  }

  enforceUserIdentityValidation (inboxId, data) {
    return axios.patch(`${this.url}/${inboxId}/enforceUserIdentityValidation`, data)
  }
}

export default new Inboxes()
